package com.spx.core.services;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import com.spx.core.services.security.AuthoritySourceProvider;
import com.spx.core.types.Activity;
import com.spx.core.types.Role;
import com.spx.core.types.User;
import com.spx.kernel.service.NonBusiness;

public interface SecurityService
{

	public abstract User addUser(final String userName, final String password);

	@NonBusiness
	public abstract void addListener(final SecurityListener listener);

	@NonBusiness
	public abstract void removeListener(final SecurityListener listener);

	public abstract User findUser(final String userName);

	public abstract Collection<User> fetchAllUsers();

	public abstract void update(final User user);

	public abstract void delete(final User user);

	public abstract void addUser(final User user);

	public abstract Set<User> fetchAllUsers(final int startAt, final int pageSize);

	

	public abstract User modify(User user);

	public abstract void modify(Role role);

	public abstract Set<Role> fetchAllRoles(int i, int maxValue);

	public abstract void addRole(Role role);

	public abstract void addAction(Activity modelObject);
	@ActivityLabel(name="find-actitity")
	public abstract Set<Activity> fetchAllActions(int i, int maxValue);

	public abstract void deleteActionFromRole(Activity activity, Role parent);

	void addActionToRole(Activity activity, Role role);

	public abstract void delete(Role model);

	public abstract void delete(Activity model);

	public abstract boolean login(String userName, String password);
    
	public User  getPresentUser();

	
	public abstract Activity findActivity(String activityLabel);

	public abstract void addLoginListener(LoginListener authoritySourceProvider);
	
	
}